x86/shadow: use single (atomic) MOV for emulated writes
authorJason Andryuk <jandryuk@gmail.com>
Fri, 17 Jan 2020 15:19:16 +0000 (16:19 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 17 Jan 2020 15:19:16 +0000 (16:19 +0100)
commit32772fbb3cf7498817304b53b087e325c6991716
treef0842ba0ebfba7055f37b21abf33742f4ae44edd
parentb05ec9263e56ef0784da766e829cfe08569d1d88
x86/shadow: use single (atomic) MOV for emulated writes

This is the corresponding change to the shadow code as made by
bf08a8a08a2e "x86/HVM: use single (atomic) MOV for aligned emulated
writes" to the non-shadow HVM code.

The bf08a8a08a2e commit message:
Using memcpy() may result in multiple individual byte accesses
(depending how memcpy() is implemented and how the resulting insns,
e.g. REP MOVSB, get carried out in hardware), which isn't what we
want/need for carrying out guest insns as correctly as possible. Fall
back to memcpy() only for accesses not 2, 4, or 8 bytes in size.

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
Acked-by: Tim Deegan <tim@xen.org>
xen/arch/x86/mm/shadow/hvm.c